package _4一维数组操作;

public class _1冒泡排序算法 {
	public static void main(String[] args) {
		int a[] = { 9, 5, 3, 4, 8, 6, 1, 5, 2, 7 };
		for (int i = 0; i <= a.length - 1; i++) {
			for (int j = 0; j <= a.length - 2 - i; j++) {
				if (a[j] > a[j + 1]) {
					int temp = a[j];
					a[j] = a[j + 1];
					a[j + 1] = temp;
				}
			}
		}
		for (int i = 0; i <= a.length - 1; i++) {
			System.out.print(a[i] + " ");
		}
	}
}